import pyautogui
import time
import random
def main():
    # 设置安全选项
    pyautogui.FAILSAFE = True
    pyautogui.PAUSE = 0.5
    
    print("1秒后开始执行...")
    time.sleep(1)
    
    try:
        time.sleep(1.24)
        pyautogui.click(583, 633)
        time.sleep(0.34568)
        pyautogui.click(583, 633)
        time.sleep(0.51)
        for ix in range(20):
            time.sleep(0.1 *random.random())
        pyautogui.press('backspace')
        pyautogui.write("778988548257",interval=0.5)
        time.sleep(3.02)
        pyautogui.click(1024, 648)
        time.sleep(2.23)
        pyautogui.click(455, 1061)
        time.sleep(6.34) #这最好有方法判断新页面是否出现了。
        pyautogui.click(436, 724)
        time.sleep(1.04)
 
        pyautogui.write("a9",interval=0.1)
        time.sleep(0.48)
        pyautogui.click(805, 713)
        time.sleep(0.99)
        pyautogui.write("16",interval=0.1)
        time.sleep(0.93)
        pyautogui.click(180, 1148)
        time.sleep(0.43)
        pyautogui.write("1")
        time.sleep(1.01)
        pyautogui.click(695, 1157)
        time.sleep(0.19)
        pyautogui.write("1") 
        pyautogui.click(1053, 1136)
        time.sleep(0.81)
        pyautogui.click(1083, 1252)
        time.sleep(0.70)
        pyautogui.scroll(-10)  # 向下滚动
        time.sleep(0.11)
        for ix in range(2): 
            time.sleep(0.1 *random.random())
            pyautogui.scroll(-120)  # 向下滚动
        time.sleep(0.21)
        pyautogui.click(561, 1161)
        # 上述是点击重量
        time.sleep(0.96)
        for ix in range(32):
            time.sleep(0.02 *random.random())
            pyautogui.scroll(-100)  # 向下滚动
        
        pyautogui.click(60, 1174)
        time.sleep(3.82)
        pyautogui.click(994, 1181)
        time.sleep(1.52)
        pyautogui.write("456",interval=0.1)
        time.sleep(2.53)
        pyautogui.click(1591, 1487)
        time.sleep(4.76)
        pyautogui.click(1240, 45)
        time.sleep(1.81)

    except Exception as e:
        print(f"执行错误: {e}")

if __name__ == "__main__":
    main()
